using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;
/*
 * There are many processes that handle the flows of data
 * we call them business logic of a program.
 * For each of business logic process we create a class 
 * that handle for that process
 * 
 * */
namespace BaHuan.BusinessLayer
{
	
	public class QuanLyKhoManagement
	{
	
		public ResultObj SaveNewQuanLyKho(QuanLyKho quanlykho)
        		{
			ResultObj result = new ResultObj();
			quanlykho.Id = -1;
			QuanLyKhoDAO quanlykhoDAO = new QuanLyKhoDAO();
			result = quanlykhoDAO.SaveQuanLyKho(quanlykho);
			
			return result;
		}
		
		public ResultObj UpdateQuanLyKho(QuanLyKho quanlykho)
        		{
			ResultObj result = new ResultObj();
			QuanLyKhoDAO quanlykhoDAO = new QuanLyKhoDAO();
			result = quanlykhoDAO.SaveQuanLyKho(quanlykho);
			
			return result;
		}
		
		public ResultObj DeleteQuanLyKho(QuanLyKho quanlykho)
        		{
			ResultObj result = new ResultObj();
			QuanLyKhoDAO quanlykhoDAO = new QuanLyKhoDAO();
			result = quanlykhoDAO.DeleteQuanLyKho(quanlykho);
			
			return result;
		}
		
		public ResultObj GetAllQuanLyKho( )
        		{
			ResultObj result = new ResultObj();
			QuanLyKhoDAO quanlykhoDAO = new QuanLyKhoDAO();
			result = quanlykhoDAO.GetAllQuanLyKho();
			
			return result;
		}
		
		public ResultObj GetQuanLyKhoById(QuanLyKho quanlykho)
        		{
			ResultObj result = new ResultObj();
			QuanLyKhoDAO quanlykhoDAO = new QuanLyKhoDAO();
			result = quanlykhoDAO.GetAllQuanLyKhoByID(quanlykho);
			
			return result;
		}

        public ResultObj GetAllTheKho()
        {
            ResultObj result = new ResultObj();
            QuanLyKhoDAO quanlykhoDAO = new QuanLyKhoDAO();
            result = quanlykhoDAO.GetAllTheKho();

            return result;
        }

        public ResultObj GetAllBCDXNT()
        {
            ResultObj result = new ResultObj();
            QuanLyKhoDAO quanlykhoDAO = new QuanLyKhoDAO();
            result = quanlykhoDAO.GetAllBCDXNT();
            return result;
        }
    }
}
